<?php
$this->layout = '/layouts/impresion.php';
?>

<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />

        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/print.css" media="print" />

        <title><?php echo CHtml::encode($this->pageTitle); ?></title>
    </head>

<div class="imprimir" id="imprimir">

    <table id="header">
           <tr>
               <td><?php echo CHtml::image(Yii::app()->baseUrl.'/images/logotipoUADY.png'); ?></td>
               <td><h1>Minuta<br/>Facultad de Matemáticas</h1></td>
           </tr>
       </table>
    <hr/>
    <table border="1" align="center" style="width: 100%">
        <tr>
            <td colspan="3"><?php echo 'Objetivo de la reunión: '.$model->objetivo;?></td>
        </tr>
        <tr>
            <td><?php echo 'Lugar: '.$model->lugar?></td>
            <td><?php echo 'Fecha: '.$model->fecha?></td>
            <td><?php echo 'Folio: '.str_pad((int) $model->id,5,"0",STR_PAD_LEFT)?></td>
        </tr>
        <tr>
            <td><?php echo 'Hora de cita: '.$model->hora_inicio;?></td>
            <td><?php echo 'Hora de inicio: '.$model->hora_inicio;?></td>
            <td><?php echo 'Hora de término: '.$model->hora_fin;?></td>
        </tr>
    </table>
    <hr/>
    <table border="1" align="center" style="width: 100%">
        <th>Participantes</th>
        <th>Asistió</th>
        <th>Aprobó</th>
        <th>Área</th>
        <th>Firma</th>
        <?php foreach ($participantes as $participante) {
        ?>
        <tr>
            <td><?php echo $participante['nombres'] ?></td>
            <td><?php echo $participante['asistio'] ?></td>
            <td><?php echo $participante['aprobo'] ?></td>
            <td><?php echo $participante['departamento'] ?></td>
            <td></td>
        </tr>
    <?php }
    ?>
    </table>
    <hr/>
    <table border="1" align="center" style="width: 100%">
        <th colspan="3">Orden del día</th>
        <?php foreach ($actividades as $actividad) { ?>
            <tr>
                <td><?php echo $actividad->descripcion; ?></td>
            </tr>
        <?php }
        ?>
    </table>
    <hr/>
    <table border="1" align="center" style="width: 100%">
        <th>Acuerdos</th>
        <th>Responsable</th>
        <th>Fecha programada</th>
        <th>Finalizado</th>
        <?php foreach ($acuerdos as $acuerdo) { ?>
            <tr>
                <td><?php echo $acuerdo['descripcion'] ?></td>
                <td><?php echo $acuerdo['responsable'] ?></td>
                <td><?php echo $acuerdo['fechaProgramada'] ?></td>
                <td>
                <?php if($acuerdo['finalizado'] == 1){ ?>
                     SI
                <?php } else{?>
                     NO
                <?php }?>
                </td>
            </tr>
            
            <?php }
    
    foreach($acuerdosSinResponsables as $acuerdoSinResponsable) {      
      
        if($acuerdoSinResponsable !== null) {
    ?>
        <tr>
            <td><?php echo $acuerdoSinResponsable->descripcion ?></td>
            <td>Sin responsable</td>
            <td><?php echo $acuerdoSinResponsable->fecha_fin ?></td>
            <td>NO</td>            
        </tr>
        
        
    <?php
        }
    }
    
    ?>
            
    </table>
</div>

<hr/>

<?php
     $this->widget('ext.mPrint.mPrint', array(
          //'title' => 'title',          //the title of the document. Defaults to the HTML title
          'tooltip' => 'Imprimir',        //tooltip message of the print icon. Defaults to 'print'
          'text' => 'Imprimir',   //text which will appear beside the print icon. Defaults to NULL
          'element' => '#imprimir',        //the element to be printed.
         // 'exceptions' => array(       //the element/s which will be ignored
            //  '.summary',
            //  '.search-form'
          //),
          'publishCss' => true,       //publish the CSS for the whole page?
          //'visible' => Yii::app()->user->checkAccess('print'),  //should this be visible to the current user?
         'visible' => true,
          //'alt' => 'print',       //text which will appear if image can't be loaded
          //'debug' => true,            //enable the debugger to see what you will get
          'id' => 'print-div'         //id of the print link
      ));
?>